package InterfaceLambdaAndInnerClasses.interfaces;

public class Employees implements Comparable<Employees>{

    private String name;
    private double salary;

    public Employees(String name, double salary) {
        this.name = name;
        this.salary = salary;
    }

    public String getName() {
        return name;
    }

    public double getSalary() {
        return salary;
    }

    public void raiseSalary(double byPercent){
        salary+=salary*byPercent/100;
    }

    @Override
    public int compareTo(Employees o) {
        return Double.compare(salary,o.salary);
    }

    @Override
    public String toString() {
        return "name= "+this.name+'\n'
                +"salary= "+this.salary;
    }
}
